﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace sunDemo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            
        }

        private void uiContextMenuStrip1_Click(object sender, EventArgs e)
        {
            
        }

        /// <summary>
        /// 右键弹出菜单项，选中触发
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void uiContextMenuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            ToolStripItem clickedItem = e.ClickedItem;
            string text = clickedItem.Text;
            MessageBox.Show(text);
            // 发现程序执行完了，菜单才消失
        }

        /// <summary>
        /// 左侧菜单项选中触发
        /// </summary>
        /// <param name="node"></param>
        /// <param name="item"></param>
        /// <param name="pageIndex"></param>
        private void uiNavMenu1_MenuItemClick(TreeNode node, 
            Sunny.UI.NavMenuItem item, 
            int pageIndex)
        {
            Type type = node.GetType();
            string name = type.Name;
            string text = node.Text;
            //MessageBox.Show(text+"/"+name+"/"+pageIndex+"/"+Convert.ToString(type.IsNested));
            //Type type1 = item.GetType();
        }
    }
}
